package com.hnhegui.backend.system.api;

import com.hnhegui.backend.entity.Result;
import com.hnhegui.backend.system.dto.request.LoginRequestDTO;
import com.hnhegui.backend.system.dto.response.LoginResponseDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "hnhegui-backend-system", path = "/api/auth", contextId = "authRestApi")
public interface AuthRestApi {

    /**
     * 用户登录
     */
    @PostMapping("/login")
    Result<LoginResponseDTO> login(@RequestBody LoginRequestDTO request);

    @PostMapping("/logout")
    Result<Void> logout(@RequestParam("userId") Long userId);
}
